package com.hc.query;

import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import lombok.ToString;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.Email;
import javax.validation.constraints.NotBlank;
import java.io.Serializable;

/**
 * @author: hecai
 * @date: 2021/11/9 11:17
 * @description:
 */
@Getter
@Setter
@ToString
@Builder
@AllArgsConstructor
@NoArgsConstructor
public class UserRegistVO implements Serializable {

    private static final long serialVersionUID = 9152586018806117948L;

    /**
     * 登录名
     */
    @NotBlank(message = "用户名不能为空")
    @Length(min = 4, max = 16, message = "以字母开头的英文字母和数字组成的4-16位字符")
    private String account;

    /**
     * 密码
     */
    @NotBlank(message = "密码不能为空")
    @Length(min = 6, max = 10, message = "密码不能含有非法字符，长度在6-10之间")
    private String password;

    /**
     * 邮编
     */
    @Email(regexp = "^[A-Za-z0-9\\u4e00-\\u9fa5]+@[a-zA-Z0-9_-]+(\\.[a-zA-Z0-9_-]+)$", message =  "邮件格式不正确")
    private String email;

    /**
     * 校验码
     */
//    @NotBlank(message = "验证码不能为空")
//    @Length(min = 4, max = 4, message = "验证码长度必须为4位")
    private String verifyCode;

}